import React from 'react';
import { Link, Switch, Route, Redirect } from 'react-router-dom';

class About extends React.Component {
    render () {
        return (
            <div>
                About
            </div>
        );
    }
}

const Home = (props) => (<div>Home</div>);

class App extends React.Component {
    render () {
        return (
            <div>
                <h2>You are not logged in.</h2>
                <ul>
                    <li><Link to="/">Home Page</Link></li>
                    <li><Link to="/about">Protected Page</Link></li>
                </ul>
                <Switch>
                    <Route exact path="/home">
                        <Home />
                    </Route>
                    <Route exact path="/about">
                        <About />
                    </Route>
                    <Redirect exact from='/' to='/home'></Redirect>
                </Switch>
            </div>
        );
    }
}

export default App;
